/// trait 继承的场景
pub fn start() {
    let page = MyPaginate {
        page: 2,
        per_page: 2,
    };
    page.set_skip_page(12);
    println!("{:?}", page);
}

trait Page {
    fn set_page(&mut self, p: i32) {
        println!("Page Default 1");
    }
}

trait PerPage {
    fn set_per_page(&mut self, num: i32) {
        println!("Per Page Default 1");
    }
}

#[derive(Debug)]
struct MyPaginate {
    page: i32,
    per_page: i32,
}

impl Page for MyPaginate {
    fn set_page(&mut self, p: i32) {
        self.page = p;
    }
}

impl PerPage for MyPaginate {
    fn set_per_page(&mut self, num: i32) {
        self.per_page = num
    }
}

trait Paginate: Page + PerPage {
    fn set_skip_page(&self, num: i32) {
        println!("Skip Page Default 1");
    }
}

impl<T> Paginate for T where T: PerPage + Page {}
